package com.shuwen.gcdj.common.exception;

import com.shuwen.gcdj.common.api.IErrorCode;

import java.io.Serializable;

/**
 * 自定义API异常1
 */
public class ApiException extends RuntimeException {
    private IErrorCode errorCode;

    private  String errorKey;
    private  Serializable[] values;


    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }


    public ApiException(String message) {
        super(message);
    }

    public IErrorCode getErrorCode() {
        return errorCode;
    }

    public ApiException( String errorKey, Serializable... values) {
        this.errorKey = errorKey;
        this.values = values;
    }


}
